package com.petecat.interchan.base.syscustom.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import com.petecat.interchan.base.syscustom.entity.SysCustom;
import com.petecat.interchan.base.syscustom.entity.SysUserProject;
import com.petecat.interchan.core.mapper.BaseMapper;
import com.petecat.interchan.protocol.base.custom.vo.SysCustomVO;

@Mapper
@Repository
public interface ICustomMapper extends BaseMapper<SysCustom, String>{
	
	/**
	 * 通过用户ID查询user_peoject表查询数据
	 * @param userId
	 * @return
	 */
	List<SysUserProject> findUserProjectByUserId(@Param("userId") String userId);
	
	/**
	 * 新增User和项目信息
	 * @param ids
	 * @param userId
	 */
	void saveUserProject(@Param("ids") String[] ids,@Param("userId") String userId);
	
	/**
	 * 删除User和项目信息
	 * @param peojectId
	 * @param userId
	 */
	void removeUserProjectById(@Param("projectId") String projectId,@Param("userId") String userId);
	
	/**
	 * 通过项目ID获取配置
	 * @param projectId
	 * @param userId
	 * @return
	 */
	SysCustom getCustomByProjectId(@Param("projectId") String projectId,@Param("userId") String userId);

}
